package com.vrv.netmgr.alarm.detail;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.TextView;

import com.vrv.netmgr.R;
import com.vrv.netmgr.vo.SerializableIllegalNetStat;

/**
 * @Description 违规上网统计策略详细信息
 * @author yangzijian
 * @date
 *
 */
public class DetailIllegalNetStatActivity extends Activity {
    //
    private SerializableIllegalNetStat info;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.detail_illegalnetstat);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_title);
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
        //
        initViews();
        setTitle();
    }

    //
    public void initViews() {
        //
        TextView className = (TextView) findViewById(R.id.class_name);
        TextView unit = (TextView) findViewById(R.id.illegalnetstat_unit);
        TextView dep = (TextView) findViewById(R.id.illegalnetstat_dep);
        TextView user = (TextView) findViewById(R.id.illegalnetstat_user);
        TextView tel = (TextView) findViewById(R.id.illegalnetstat_tel);
        TextView ip = (TextView) findViewById(R.id.illegalnetstat_ip);
        TextView start = (TextView) findViewById(R.id.illegalnetstat_start);
        TextView end = (TextView) findViewById(R.id.illegalnetstat_end);
        TextView count = (TextView) findViewById(R.id.illegalnetstat_count);
        TextView time = (TextView) findViewById(R.id.illegalnetstat_time);
        TextView type = (TextView) findViewById(R.id.openiionet_type);
        //
        info = (SerializableIllegalNetStat) getIntent().getSerializableExtra("info");
        //
        className.setText(info.getClassName());
        unit.setText(info.getUNIT_NAME());
        dep.setText(info.getDEP_NAME());
        user.setText(info.getUSER_NAME());
        tel.setText(info.getTEL());
        ip.setText(info.getDEV_IP());
        start.setText(info.getNET_START_TIME());
        end.setText(info.getNET_END_TIME());
        count.setText(info.getNET_FREQUENCY());
        time.setText(info.getNET_TIME());
        type.setText(info.getALARM_TYPE());
    }

    public void setTitle() {
        TextView title = (TextView) findViewById(R.id.title_text);
        title.setText("违规上网统计" + "[" + info.DEV_IP + "]");

        /**
         * 返回按钮
         */
        ImageButton backBtn = (ImageButton) findViewById(R.id.backBtn);
        backBtn.setVisibility(View.VISIBLE);
        backBtn.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }

    @Override
    public void onBackPressed() {
        finish();
        overridePendingTransition(R.anim.push_right_out, R.anim.push_right_in);
        super.onBackPressed();
    }
}
